using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Mvc.Ajax;
using QianJin.Views;
using QianJin.Models;

namespace QianJin.Controllers
{
    

    public class HomeController : BaseController
    {
        //
        // GET: /Home/

        public ActionResult Index()
        {
            var categoryId = "{00000000-0000-0000-0000-000000000000}";
            return View("Home", 
                new HomeViewData() 
                { 
                    Categories = ProductDatabase.Instance.GetAllCategories(),
                    LatestProducts = ProductDatabase.Instance.GetAllProductsFromCategory(categoryId),
                    CurrentCategory = ProductDatabase.Instance.GetCategory(categoryId)
                }
            );
        }

        public ActionResult ShowCompanyInfo()
        {

            return View(
                "Company",
                new BaseViewData()
                {
                    User = this.CurrentUser,
                    ProductCategories = ProductDatabase.Instance.GetAllCategories(),
                }
            );
        }

        public ActionResult ShowContactUs()
        {
            return View(
                 "ContactUs",
                 new BaseViewData()
                 {
                     User = this.CurrentUser,
                     ProductCategories = ProductDatabase.Instance.GetAllCategories(),
                 }
             );
        }
    }
}
